﻿using System;
using System.Runtime.Serialization;

namespace TongCheng.API.OpenAPI
{
    /// <summary>
    /// Tc客户端异常。
    /// </summary>
    public class TcException : Exception
    {
        private string rspCode;
        private string rspDesc;

        public TcException()
            : base()
        {
        }

        public TcException(string message)
            : base(message)
        {
        }

        protected TcException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }

        public TcException(string message, Exception innerException)
            : base(message, innerException)
        {
        }

        public TcException(string rspCode, string rspDesc)
            : base(rspCode + ":" + rspDesc)
        {
            this.rspCode = rspCode;
            this.rspDesc = rspDesc;
        }

        public string RspCode
        {
            get { return this.rspCode; }
        }

        public string RspDesc
        {
            get { return this.rspDesc; }
        }
    }
}
